﻿using System;
using System.Linq;
using Solution.BusinessObject;
using Solution.Controls;
using Solution.Core;

namespace Solution
{
    public partial class _Default : PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            var albumSlider = (AlbumSlider) this.LoadControl("Controls/AlbumSlider.ascx");
            //var masterCategories = (MasterCategory)this.LoadControl("Controls/MasterCategory.ascx");

            var randomAlbum = CommonBO.MasterEDM.Contents.OrderBy(p => Guid.NewGuid()).FirstOrDefault();
            if (randomAlbum != null)
            {
                albumSlider.AlbumId = randomAlbum.Id;
            }
            phdAlbumSlider.Controls.Add(albumSlider);
            //phdAlbumSlider.Controls.Add(masterCategories);
        }
    }
}